<?=$this->load->view('include_header',null)?>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('archive/idcard/'.$id)?>" class="report"><?=(empty($id))?"录入新":"编辑"?>客户基本信息</a></li>
				<?php if(!empty($info->id)):?><li><a id="printInfo" class="folder_table">打印本页信息</a></li><?php endif;?>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
<!-- table begin -->
<form method="post" id="form"  enctype="multipart/form-data" action="<?=site_url('schengen/th_update/'.$cateid)?>">

	<h3>泰国申请表</h3>
    <table width="100%">
    <thead>
        <tr>
          <td colspan="4" align="right"><img src="<?= (@$info->avatar)?@$info->avatar:'images/avatar.gif'?>" width="150" height="150" /></td>
		  <td align="right">
		  上传照片<br />
		  <input type="file" name="userphoto" /><br />
		  (.gif|.jpg|.png文件,最大1M)<br />
		  <?php if (@$info->attachment):?><a href="<?= @$info->attachment?>" target="_blank">点击下载附件</a><?php endif; ?>
		  &nbsp;&nbsp;&nbsp;&nbsp;上传附件<br />
		  <input type="file" name="userfile" /><br />
		  (.pdf|.zip|.rar|.doc,最大2M)		  
		  </td>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="5" align="right">			
			<input type="hidden" name="id" value="<?=$id?>" />
			<input id="button1" type="submit" value="提交信息" />
			<input id="button2" type="reset" value="重置" />
			</td>
        </tr>
    </tfoot>

    <tbody>
        <tr class="odd">
            <td colspan="5"><div align="center"><strong>以英文填写</strong></div></td>
        </tr>
        <tr class="even">
            <td>Name姓名</td>
            <td><input type="text" name="name" value="<?= @$info->name?>" />
              <br />
              （block letters 大写）</td>
            <td>&nbsp;</td>
            <td>Nationality国籍</td>
            <td><input type="text" name="nationality" value="<?= @$info->nationality?>" /></td>
        </tr>
        <tr class="odd">
            <td>Date of Birth出生日期</td>
            <td nowrap="nowrap"><input type="text" name="birth" value="<?= @$info->birth?>" id="birth"/></td>
            <td>&nbsp;</td>
            <td>Place of Birth出生地</td>
            <td><input type="text" name="birth_place" value="<?= @$info->birth_place?>" /></td>
        </tr>
        <tr class="even">
            <td>Prefession（present）现职业</td>
            <td><input type="text" name="prefession" value="<?= @$info->prefession?>" /></td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <tr class="odd">
           <td>Present address现住址</td>
            <td colspan="4"><input name="present_address" type="text" value="<?= @$info->present_address?>" style="width:500px" /></td>
        </tr>
        <tr class="even">
          <td>Permanent address （if different from above）<br />永久地址（如与现住址不同，请注明）</td>
            <td colspan="4"><input name="permanent_address" type="text" value="<?= @$info->permanent_address?>" style="width:500px" /></td>
        </tr>
        <tr class="odd">
            <td>Passport No.护照号码</td>
            <td><input type="text" name="travel_document_num" value="<?= @$info->travel_document_num?>" /></td>
            <td>&nbsp;</td>
            <td>Issued at签发地</td>
            <td><input type="text" name="travel_document_issue_place" value="<?= @$info->travel_document_issue_place?>" /></td>
        </tr>
        <tr class="even">
            <td>Date of issue签发日期</td>
            <td><input type="text" name="travel_document_issue_date" value="<?= @$info->travel_document_issue_date?>" id="travel_document_issue_date" /></td>
            <td>&nbsp;</td>
            <td>Expiry date有效日期至</td>
            <td><input type="text" name="travel_document_valid_date" value="<?= @$info->travel_document_valid_date?>" id="travel_document_valid_date" /></td>
        </tr>
        <tr class="odd">
            <td colspan="2">Name, dates and place of birth of minor children holding the same passport and if accompanying you<br />
              有否用同本护照的儿童随行,如有请填写姓名,出生地及出生日期</td>
            <td colspan="3">
              <textarea name="child"><?= @$info->child?></textarea>
            </td>
        </tr>
        <tr class="even">
            <td>Countries for which passport is valid<br />护照适用国</td>
            <td><input type="text" name="travel_document_country" value="<?= @$info->travel_document_country?>"/></td>
            <td>&nbsp;</td>
            <td>Date of previous visits to Thailand<br />上次赴泰日期</td>
            <td><input type="text" name="pre_date" value="<?= @$info->pre_date?>" id="pre_date"/></td>
        </tr>
		        <tr class="odd">
            <td>Purpose of visit访问目的</td>
            <td colspan="4"><input name="purpose" type="text" value="<?= @$info->purpose?>" style="width:500px" /></td>
        </tr>
        <tr class="even">
            <td>Date of arrival in Thailand入泰时间</td>
            <td><input type="text" name="arrival_date" value="<?= @$info->arrival_date?>" id="arrival_date" /></td>
            <td>&nbsp;</td>
            <td>by （Flight No.班机号）</td>
            <td><input type="text" name="flight" value="<?= @$info->flight?>" /></td>
        </tr>		
        <tr class="odd">
            <td>Duration of proposed stay停留时间</td>
            <td colspan="4"><input type="text" name="stay_duration" value="<?= @$info->stay_duration?>" />			</td>
        </tr>
        <tr class="even">
            <td>Local guarantor and address<br />本国担保人姓名及住址</td>
            <td colspan="4"><input name="guarantor" type="text" value="<?= @$info->guarantor?>" style="width:500px"/></td>
        </tr>
        <tr class="odd">
            <td>Reference person and/or address in Thailand<br/>泰国联系人及/或地址</td>
            <td colspan="4"><input name="contacter" type="text" value="<?= @$info->contacter?>" style="width:500px"/></td>
        </tr>
        <tr class="even">
            <td colspan="5">ATTENEION FOR APPLICANT<br />
              I hereby declare that the above mentioned informa-tion is correct and that in no case shall I violate Thai laws and regulations while in the country.<br />
              在此我声明所填内容属实,并保证不违反泰国的法律</td>
        </tr>

        
    </tbody>
	</table>
<!-- table end -->
</form>

			</div>
		</div>
		
		<?=$this->load->view('include_sidebar',array('id'=>$id,'forms'=>$forms))?>
	</div>

<script type="text/javascript">
$().ready(function() {
  $("#form").validate({
    rules: {
		name:"required",
		nationality:"required",
		birth:"required",
		birth_place:"required",
		present_address:"required",
		travel_document_num:"required",
		travel_document_issue_place:"required",
		travel_document_issue_date:"required",
		travel_document_valid_date:"required"
    }
  });
  
	$.datepicker.setDefaults(
		{
		dateFormat: 'yy/mm/dd',
		changeMonth: true,
		changeYear: true,
		showOn: "both",
		buttonImage: "images/calendar.gif",
		buttonImageOnly: true
		}
	);

	$("#birth").datepicker();
	$("#travel_document_issue_date").datepicker();
	$("#travel_document_valid_date").datepicker();
	$("#pre_date").datepicker();
	$("#arrival_date").datepicker();
	

	$("#printInfo").click(function(o) {
		var prints = [
			{rel_id: <?=$cateid?>, rec_id: <?=$id?>}
		]  ;
		
		var jdata = JSON.stringify(prints);
		//alert(jdata);
		$.post("<?=site_url('proxy/does/'.str_replace('==','',base64_encode('http://'.$_SERVER['SERVER_NAME'].':9090/javaprduct/servlet/test')))?>",{clients:jdata},function(msg){alert(msg)});
	});
	
	$("#printInfo").ajaxError(function(event,request, settings){
		//$(this).append("<li>出错页面:" + settings.url + "</li>");
		alert("无法访问"+ settings.url );
	}); 
 
});
</script>

<?=$this->load->view('include_footer',null)?>